#include "lightWidget.h"

#include <QPushButton>
#include <QLayout>

lightWidget::lightWidget(QWidget* parent)
{
	_directionalButton = new QPushButton("Directional light");
	_directionalButton->setCheckable(true);

	_spotButton = new QPushButton("Spot light");
	_spotButton->setCheckable(true);

	_pointButton = new QPushButton("Point light");
	_pointButton->setCheckable(true);

	QGridLayout* grid = new QGridLayout();
	grid->addWidget(_directionalButton, 0, 0, 1, 1);
	grid->addWidget(_spotButton, 1, 0, 1, 1);
	grid->addWidget(_pointButton, 2, 0, 1, 1);
	grid->addWidget(new QWidget, 3, 0, 1, 1);

	setLayout(grid);

	//connect the directional button
	//connect(_directionalButton, SIGNAL(clicked()), this, SLOT(unCheckAll()));
	//connect(_directionalButton, SIGNAL(clicked()), this, SLOT(checkDirectionalButton()));

	////connect the spot button
	//connect(_spotButton, SIGNAL(clicked()), this, SLOT(unCheckAll()));
	//connect(_spotButton, SIGNAL(clicked()), this, SLOT(checkSpotButton()));

	////connect the point button
	//connect(_pointButton, SIGNAL(clicked()), this, SLOT(unCheckAll()));
	//connect(_pointButton, SIGNAL(clicked()), this, SLOT(checkPointButton()));
}

lightWidget::~lightWidget()
{
}

//uncheck all the buttons
void lightWidget::unCheckAll()
{
	_directionalButton->setChecked(false);
	_spotButton->setChecked(false);
	_pointButton->setChecked(false);
}

//check the directional light button
void lightWidget::checkDirectionalButton()
{
	_directionalButton->setChecked(true);
}

//check the spot light button
void lightWidget::checkSpotButton()
{
	_spotButton->setChecked(true);
}

//check the directional light button
void lightWidget::checkPointButton()
{
	_pointButton->setChecked(true);
}